package com.kuyu.wx;

public class UserInfoUtil {
    //获取code的请求地址
    public static String Get_Code = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=%s&state=STAT#wechat_redirect";
    //替换字符串
    public static String getCode(String APPID, String REDIRECT_URI,String SCOPE) {
        return String.format(Get_Code,APPID,REDIRECT_URI,SCOPE);
    }

    public static void main(String[] args) {
        String  REDIRECT_URI = "http://mym.nat300.top/wx/getopenid";
        String SCOPE = "snsapi_base";
        //appId
        String appId = "wxa333c9dbd51a3b3a";

        String getCodeUrl = getCode(appId, REDIRECT_URI, SCOPE);
        System.out.println("getCodeUrl:"+getCodeUrl);
    }
}
